package com.bailan.foreat.service;

import com.bailan.foreat.entity.Comment;
import com.bailan.foreat.entity.Order;
import com.bailan.foreat.entity.User;
import com.bailan.foreat.vo.CartVo;
import com.bailan.foreat.vo.OrderVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
public interface OrderService extends IService<Order> {
    CartVo getCartVo(Integer userId, Integer[] productIds);

    @Transactional
    void createOrder(User currentUser, Integer[] productIds, Integer addressId);

    String updateOrderStatus(Integer orderId, Integer newState);

    void updateItemStatus(Integer itemId, Integer newState);

    void receivingOrderItem(Integer orderId, Integer storeId, Integer newStatus);

    Integer getOrderStatus(Integer orderId);

    void updateOrderItemStatus(Integer orderId, Integer storeId, Integer newStatus);

    void refundOrderItem(Integer orderId, Integer storeId, Integer newStatus, String refundReason);

    String checkOrderItem(Integer itemId);

    String reviewOrderItem(List<Comment> comments, Integer userId);

    Page<OrderVo> queryAllOrder(Integer currentPage, Integer pageSize, String keyword, User currentUser);

}
